<%@ page language="java" pageEncoding="UTF-8"%>
<%@page import="com.usernet.product.tools.AdminRight"%>
<%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic"%>
<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean"%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
	<head>
		<link rel="stylesheet" type="text/css" href="resources/css/style.css">
		<script src="resources/js/comm.js"></script>
		<script type="text/javascript">
			function checkForm(){
				submitForm('queryform');
			}
		</script>

	</head>
	<body onkeydown="if(event.keyCode==27) return false;">
		<jsp:include page="../inc/header.jsp"></jsp:include>
		<form id="queryform" action="type.do" method="post">
		<input type="hidden" name="method" value="toList">
		<input type="hidden" id="pageNo" name="pageNo" value="${page.currentPage }">
		<input type="hidden" id="pageSize" name="pageSize" value="${page.everyPage}">
		<table width="100%" border="0" cellspacing="0" cellpadding="0">
			<tr>
				<td height="30" background="resources/images/other/tab_05.gif">
					<table width="100%" border="0" cellspacing="0" cellpadding="0">
						<tr>
							<td width="12" height="30">
								<img src="resources/images/other/tab_03.gif" width="12"
									height="30" />
							</td>
							<td>
								<div class="page_title">
									<img align="middle" src="resources/images/other/tb.gif"
										width="16" height="16" />
									 分类信息管理  
								</div>
							</td>
							<td>
								<div class="button_bar">
									<input value="添加分类" type="button" class="common_button"
										onclick="javascript:window.location='type.do?method=toAdd';loading();">
									<input value="查询" type="button" class="common_button" onclick="checkForm();loading();">
									<input value="刷新" type="button" class="common_button"
										onclick="checkForm();loading();">
								</div>
							</td>
							<td width="16">
								<img src="resources/images/other/tab_07.gif" width="16"
									height="30" />
							</td>
						</tr>
					</table>
				</td>
			</tr>
			<tr>
				<td>
					<table width="100%" border="0" cellspacing="0" cellpadding="0">
						<tr>
							<td width="8" background="resources/images/other/tab_12.gif">
							</td>
							<td>
									<table cellspacing="1" cellpadding="0" class="query_form_table">
										<tr>
											<th>
												分类名称(可拼音搜索)
											</th>
											<td>
												<input id="name" name="name" value="${form.name }" />
											</td>
											<td>
												<select id="flag" name="flag" style="width: 80%">
													<option value="-1">--请选择--</option>
													<option value="1"
													<logic:equal value="1" name="form" property="flag">
													selected
													</logic:equal>>应用</option>
													<option value="2"
													<logic:equal value="2" name="form" property="flag">
													selected
													</logic:equal>>游戏</option>
												</select>
												<button class="common_button"
													onclick="$('name').value='';$('flag').value=-1;checkForm();loading();">
													 清空
												</button>
											</td>
										</tr>
									</table>
								<br />
								<table cellspacing="1" cellpadding="0" class="data_list_table">
									<tr>
										<th>
											名称
										</th>
										<th>
											排序
										</th>
										<th>
											图标
										</th>
										<th>
											类型
										</th>
										<th>
											拼音
										</th>
										<th>
											备注
										</th>
										<th>
											状态
										</th>
										<th>
											操作
										</th>
									</tr>
									<logic:present name="list">
										<logic:iterate id="item" name="list">
											<tr onclick="clickto();" onmousemove="changeto();"
												onmouseout="changeback();">
												<td class="list_data_number">
													${item.name }
												</td>
												<td class="list_data_ltext">
													<span>${item.sort }</span>
												</td>
												<td class="list_data_number">
													<img onmousemove="mover(this);" onmouseout="mout(this);"
													onclick="location='type.do?method=show&url=${item.icon }&t=0';loading();"
													title="查看ICON" src="resources/images/bt_feedback.gif"
													class="op_button" />
												</td>
												<td class="list_data_ltext">
													<logic:equal value="1" name="item" property="flag">
														应用
													</logic:equal>
													<logic:equal value="2" name="item" property="flag">
														游戏
													</logic:equal>
												</td>
												<td class="list_data_ltext">
													${item.pinyin }
												</td>
												<td class="list_data_ltext">
													${item.remark }
												</td>
												<td class="list_data_ltext">
													<logic:equal value="0" name="item" property="status">
														<span class="red_star">可用</span>
													</logic:equal>
													<logic:equal value="1" name="item" property="status">
														<span class="red_star">锁定</span>
													</logic:equal>
												</td>
												<td class="list_data_op">
													<img onmousemove="mover(this);" onmouseout="mout(this);"
														onclick="javascript:location='type.do?method=toUpdate&id=${item.id }';loading();"
														title="编辑" src="resources/images/bt_edit.gif"
														class="op_button" />
													<logic:equal value="0" name="item" property="status">
														<img onmousemove="mover(this);" onmouseout="mout(this);"
														onclick="javascript:if(window.confirm('确认锁定吗?')){location='type.do?method=doCancle&id=${item.id}';loading();}"
														title="锁定" src="resources/images/bt_deal.gif"
														class="op_button" />
													</logic:equal>
													<logic:equal value="<%=String.valueOf(AdminRight.supers) %>" name="admin" property="flag">
													<logic:equal value="1" name="item" property="status">
														<img onmousemove="mover(this);" onmouseout="mout(this);"
														onclick="javascript:if(window.confirm('确认解锁吗?')){location='type.do?method=doOk&id=${item.id}';loading();}"
														title="解锁" src="resources/images/bt_yes.gif"
														class="op_button" />
													</logic:equal>
													</logic:equal>
													<logic:equal value="<%=String.valueOf(AdminRight.supers) %>" name="admin" property="flag">
													<img onmousemove="mover(this);" onmouseout="mout(this);"
														onclick="javascript:if(window.confirm('确认删除吗?')){location='type.do?method=doDelete&id=${item.id}';loading();}"
														title="删除" src="resources/images/bt_del.gif"
														class="op_button" />
													</logic:equal>
												</td>
											</tr>
										</logic:iterate>
									</logic:present>
									<logic:notPresent name="list">
										<tr>
											<td colspan="11" class="list_data_text">
												<font color="red">当前没有任何信息</font>
											</td>
										</tr>
									</logic:notPresent>
								</table>
							</td>
							<td width="8" background="resources/images/other/tab_15.gif">
							</td>
						</tr>
					</table>
				</td>
			</tr>
			<tr>
				<td height="35" background="resources/images/other/tab_19.gif">
					<table width="100%" border="0" cellspacing="0" cellpadding="0">
						<tr>
							<td width="12" height="30">
								<img src="resources/images/other/tab_18.gif" width="12"
									height="35" />
							</td>
							<td>
								<div class="pager">
									共${page.totalCount }条记录 每页
									<select
										onchange="changePageSize(this.value);">
										<logic:iterate id="size" name="size">
											<option value="${size }"
												<logic:equal value="${size}" name="page" property="everyPage">
									selected
									</logic:equal>>
												${size }
											</option>
										</logic:iterate>

									</select>
									条 第
									<input value="${page.currentPage }" size="2" />
									页/共${page.totalPage }页
									<a
										href="javascript:changePage(1,${page.totalPage},${page.everyPage})">第一页</a>
									<a
										href="javascript:changePage(${page.currentPage-1},${page.totalPage},${page.everyPage})">上一页</a>
									<a
										href="javascript:changePage(${page.currentPage+1},${page.totalPage},${page.everyPage})">下一页</a>
									<a
										href="javascript:changePage(${page.totalPage},${page.totalPage},${page.everyPage})">最后一页</a>
									转到
									<input id="goto" size="2" />
									页
									<input value="GO" type="button" width="20" class="common_button"
										onclick="changePage('goto',${page.totalPage},${page.everyPage});">
								</div>
							</td>
							<td width="16">
								<img src="resources/images/other/tab_20.gif" width="16"
									height="35" />
							</td>
						</tr>
					</table>
				</td>
			</tr>
		</table>
		</form>
	</body>
</html>
<jsp:include page="../inc/footer.jsp"></jsp:include>